package
{
	import com.AppConfing;
	import com.AppFacade;
	import com.messagers.AppLoadExportUISkin;
	import com.messagers.MouseMessager;
	import com.views.UIBase;
	import com.views.UIBottom;
	import com.views.UIEditor;
	import com.views.UILayer;
	import com.views.UIProperty;
	import com.views.UITop;
	import com.views.UIUserdefined;
	
	import feathers.themes.MetalWorksMobileTheme;
	
	import flash.display.Stage;
	import flash.events.MouseEvent;
	
	import starling.display.Sprite;
	import starling.events.Event;
	/**
	 * 主程序 
	 * @author shishujun
	 * 
	 */	
	public class UIExportMain extends Sprite
	{
		public var uitop : UITop;
		public var uibase : UIBase;
		public var uiuserdefined : UIUserdefined;
		public var uiproperty : UIProperty;
		public var uilayer : UILayer;
		public var uieditor : UIEditor;
		public var uibottom : UIBottom;
		
		public function UIExportMain()
		{
			super();
			this.addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler );
		}
		
		private function addedToStageHandler( event:Event ):void
		{
			new MetalWorksMobileTheme(this.stage);
			AppConfing.Create();
			MouseMessager.Create(this.stage);
			AppLoadExportUISkin.loadExportAssets(loadComplete);
		}
		
		private function loadComplete() : void
		{
			uitop = new UITop();
			uibottom = new UIBottom();
			uibottom.y = 580;
			
			uibase = new UIBase();
			uibase.y = 28;
			
			uiuserdefined = new UIUserdefined();
			uiuserdefined.y = 310;
			
			uiproperty = new UIProperty();
			uiproperty.y = 28;
			uiproperty.x = 868;
			
			uilayer = new UILayer();
			uilayer.y = 400;
			uilayer.x = 868;
			
			uieditor = new UIEditor();
			uieditor.y = 28;
			uieditor.x = 160;
			
			this.addChild(uitop);
			this.addChild(uibase);
			this.addChild(uiuserdefined);
			this.addChild(uiproperty);
			this.addChild(uilayer);
			this.addChild(uieditor);
			this.addChild(uibottom);
			AppFacade.Instance().StartUp(this);
		}
	}
}